package net.atomarrow.bs.service;

import net.atomarrow.bs.domain.TbAccount;
import net.atomarrow.db.annotation.Transaction;
import net.atomarrow.db.parser.Conditions;
import net.atomarrow.services.Service;

import java.util.List;

public class HelloService extends Service {
    @Transaction
    public void sayHello(){
        System.out.println("hello service");
//        Conditions conditions =new Conditions(TbAccount.class);
//        System.out.println(getCount(conditions));
//        List<TbAccount> users = getList(new Conditions(TbAccount.class));
//        for(TbAccount user:users){
//        	System.out.println(user.getName());
//        }
    }

    public List<TbAccount> getAll() {
    	 List<TbAccount> users= getList(new Conditions(TbAccount.class));
    	 getOne(new Conditions(TbAccount.class));

    	return users;
    }


    public List<TbAccount> addAll2() {
    	getCount(new Conditions(TbAccount.class));
    	List<TbAccount> users= getList(new Conditions(TbAccount.class));
    	 error("回滚");
    	return users;
    }

}
